package yu.code.yurpc.handler;

import cn.hutool.core.io.resource.NoResourceException;
import cn.hutool.setting.dialect.Props;

/**
 * properties 文件配置文件处理器
 */
public class PropsHandler implements ConfigHandler {
    @Override
    public <T> T loadConfig(Class<T> tClass, String filePath) {
        Props props = new Props(filePath);
        return props.toBean(tClass);
    }
    @Override
    public <T> T loadConfig(Class<T> tClass, String prefix, String filePath) {
        Props props = new Props(filePath);
        return props.toBean(tClass, prefix);
    }
}
